import { useRouter } from "next/router";
import * as React from "react";
import styles from "./style.module.scss";
import { Menu } from "antd";

interface Props {
  area: string;
}

export default function Nav(props: Props) {
  const router = useRouter();

  return (
    <Menu
      className={styles.menu}
      onClick={(e) => {
        router.push("/" + e.key);
      }}
      selectedKeys={[props.area]}
      mode="horizontal"
    >
      <Menu.Item key="login">登录</Menu.Item>
      <Menu.Item key="register">注册</Menu.Item>
    </Menu>
  );
}
